package aaaBrowser;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import net.sf.json.JSONObject;
import aaaBrowser.model.PushModel;
import aaaBrowser.model.StoModel;
import aaaBrowser.model.TaskModel;

import com.attilax.net.websitex;
import com.attilax.util.mainThreadEnd;
import com.attilax.web.UrlX;

/**
 * 向服务器发送请求
 * 
 * @author  moyan
 * @version  [版本号, 2015年4月26日]
 * @see  [相关类/方法]
 * @since  [产品/模块版本]
 */
public class ResTask
{
    public static void main(String[] args){
        
    }
    
    public TaskModel store(StoModel store,Map map){
        String url = "http://sh.weijicn.cn/api/client.php";
        Map mp = new HashMap();
        mp.put("task_id",map.get("task_id"));
        mp.put("task_type","reg_return");
        mp.put("task_status","1");
        mp.put("task_ssid",map.get("task_ssid"));
        mp.put("uid",store.getUid());
        mp.put("siteid",store.getSiteid());
        mp.put("username",store.getUsername());
        mp.put("password",store.getPassword());
        System.out.println(store.getUsername());
     
     
        String  url2=url+"?"+UrlX.getQueryStr(mp, "utf-8");
        System.out.println(url2);
        String s = websitex.WebpageContent(url2);
        System.out.println("store:"+s);
        JSONObject jsonobject = JSONObject.fromObject(s);
        TaskModel tam=new TaskModel();
        tam.setTaskid((String)jsonobject.get("task_id"));
        tam.setTasktype((String)jsonobject.get("task_type"));
        System.out.println(tam);
        return null;
    }
    
    public void queretrun(Map map){
        String url = "http://sh.weijicn.cn/api/client.php";
        Map mp = new HashMap();
        mp.put("task_id",(String)map.get("task_id"));
        mp.put("task_type","question");
       mp.put("ssid",(String)map.get("task_ssid"));
        String  url2=url+"?"+UrlX.getQueryStr(mp, "utf-8");
        String s = websitex.WebpageContent(url2); 
        System.out.println("ques:"+s);
        
    }
    public void pubretrun(Map map,Map map1){
        String url = "http://sh.weijicn.cn/api/client.php";
        Map mp = new HashMap();
        mp.put("task_id",(String)map.get("task_id"));
        mp.put("task_type","pub_return");
        mp.put("task_ssid",(String)map.get("task_ssid"));
        mp.put("postedid",(String)map1.get("postedid"));
        mp.put("siteid",(String)map1.get("siteid"));
        mp.put("linkurl",(String)map1.get("linkurl"));
        mp.put("uid",(String)map1.get("uid"));
     //   mp.put("ssid",ssid);
        String  url2=url+"?"+UrlX.getQueryStr(mp, "utf-8");
        String s = websitex.WebpageContent(url2); 
        System.out.println("store:"+url2);
        
    }
  
}
